const { professionAndIndustryRelativeService } = require('../../../service/serviceEnter')
const {baseController} = require('../../baseController')
const result= require('../../../util/result/result');
const serviceEnter= require('../../../service/serviceEnter');

class industryController  extends baseController{

  static sigleIns = new industryController()

  static getSigleIns =()=>{
      if(this.sigleIns){
          return this.sigleIns
      }else{
          return new industryController()
      }
  }


    constructor(){
      super(serviceEnter.industryService.getIns())
    }


    // 根据行业查询职业
 async   queryProfessionByIndustry(req,res){
       let s1= professionAndIndustryRelativeService.getIns()


    let cc

    if(req.body.industryID.length!==0){
      try {
        cc=  await   s1.findByIndustryIdAndAggregate(req.body.industryID)
     } catch (error) {
       console.log(error)
       return
     }

    }else{
      return
     
    }
    res.send(result.result(true,cc))
       
    }


}


module.exports={
    industryController

}